package com.itheima.kebian;

import java.util.ArrayList;
import java.util.List;

/*
可变参数的使用
创建不可变集合

List.of

 */
public class Demo02 {


    public static void main(String[] args) {
        List<String> list = List.of("吴亦凡", "吴亦凡", "吴亦凡", "吴亦凡", "吴亦凡");
        System.out.println(list);
       // list.add("鹿晗");
        //list.remove("吴亦凡");
       // list.set(0,"吴签");
        System.out.println(list.get(0));

        ArrayList<String> list1 = new ArrayList<>(list);
        list1.add("luhan");
        list1.remove("吴亦凡");
         list1.set(0,"吴签");
        System.out.println(list1);

        ArrayList<String> list2 = new ArrayList<>(List.of("鹿晗", "黄子韬", "张艺兴"));
        System.out.println(list2);
    }
}
